I failed FizzBuzz, would you hire me? [closed]
Posted
by
ja_programmer
on Programmers
See other posts from Programmers
or by ja_programmer
Published on 2012-12-06T20:22:08Z
Indexed on
2012/12/06
23:24 UTC
Read the original article
Hit count: 136
interview
I'm a developer with a CS degree and have work experience doing development in a number of languages for almost 3 years.
Today had an interview (2nd interview) with a panel of people. Overall it went quite well, I prepared for most of the questions and felt ready for anything. At the end of the interview, they gave me ONE programming question...a problem like FizzBuzz (without the print the number part). I believe I made too many mistakes and thus have "failed" it. Is all hope lost for me?
Here is my code:
void FizzBuzz()
{
for(int i = 0; i <= 100; i++)
{
bool isThree = i % 3;
bool isFive = i % 5;
if (isThree)
{
print "Fizz\n";
}
else if(isFive)
{
print "Buzz\n";
}
else
{
print "FizzBuzz\n";
}
}
}
As you can see I messed up the bools which should have the syntax i % 3 == 0; If I'm remembering the question right I also put an else instead of an elseif with isThree && isFive. I was quite stressed, but that's no excuse for missing a simple problem.
So the question is, if my work history and personality fit with the job and this is the only code you've seen, would you hire me?
© Programmers or respective owner